package com.yfp.machine.service.impl;

import com.yfp.machine.domain.DeviceCurrentComboPlanRoad;
import com.yfp.machine.mapper.DeviceCurrentComboPlanRoadMapper;
import com.yfp.machine.service.DeviceCurrentComboPlanRoadService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * (DeviceCurrentComboPlanRoad)表服务实现类
 *
 * 
 * @since 2024-01-24 14:47:24
 */
@Service("deviceCurrentComboPlanRoadService")
public class DeviceCurrentComboPlanRoadServiceImpl implements DeviceCurrentComboPlanRoadService {
    @Resource
    private DeviceCurrentComboPlanRoadMapper deviceCurrentComboPlanRoadMapper;

    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    @Override
    public DeviceCurrentComboPlanRoad queryById(String id) {
        return this.deviceCurrentComboPlanRoadMapper.queryById(id);
    }

    /**
     * 分页查询
     *
     * @param deviceCurrentComboPlanRoad 筛选条件
     * @return 查询结果
     */
    @Override
    public List<DeviceCurrentComboPlanRoad> queryByPage(DeviceCurrentComboPlanRoad deviceCurrentComboPlanRoad) {
        return this.deviceCurrentComboPlanRoadMapper.queryAllByLimit(deviceCurrentComboPlanRoad);
    }

    /**
     * 新增数据
     *
     * @param deviceCurrentComboPlanRoad 实例对象
     * @return 实例对象
     */
    @Override
    public DeviceCurrentComboPlanRoad insert(DeviceCurrentComboPlanRoad deviceCurrentComboPlanRoad) {
        this.deviceCurrentComboPlanRoadMapper.insert(deviceCurrentComboPlanRoad);
        return deviceCurrentComboPlanRoad;
    }

    /**
     * 修改数据
     *
     * @param deviceCurrentComboPlanRoad 实例对象
     * @return 实例对象
     */
    @Override
    public DeviceCurrentComboPlanRoad update(DeviceCurrentComboPlanRoad deviceCurrentComboPlanRoad) {
        this.deviceCurrentComboPlanRoadMapper.update(deviceCurrentComboPlanRoad);
        return this.queryById(deviceCurrentComboPlanRoad.getId());
    }

    @Override
    public List<DeviceCurrentComboPlanRoad> getAllByMachineId(String machineId) {
        return this.deviceCurrentComboPlanRoadMapper.getAllByMachineId(machineId);
    }
}
